#include<iostream>
#include<algorithm>
using namespace std;
const int N = 1e5 + 10;
int a[N];
int n, m, c;
int check(int x)
{
	int cnt = 0;
	int l = 1, r = 1;
	while (r <= n)
	{
		while (r <= n && r - l + 1 <= c && a[r] - a[l] <= x)
		{
			r++;
		}
		cnt++;
		l = r;
	}
	return cnt;
}
int main()
{
	cin >> n >> m >> c;
	int l = 0, r = 0;
	for (int i = 1; i <= n; i++)
	{
		cin >> a[i];
	}
	sort(a + 1, a + 1 + n);
	r = a[n] - a[1];
	while (l < r)
	{
		int mid = (l + r) / 2;
		if (check(mid) <= m) r = mid;
		else l = mid + 1;
	}
	cout << l << endl;
	return 0;
}